package com.example.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 季舟
 * @Date 2024-09-10 11:14
 */
@RestController
@RefreshScope
public class NacosController {

    @Value("${abc}")
    private String nacosConfig;

    @RequestMapping("/getConfig")
    public String getConfig(){
        return "从Nacos中获取到了配置项: " + nacosConfig;
    }

}
